import http from '@/utils/axios'
import { LoginParams, UserInfoModel } from './model/userModel'

enum Api {
  Login = '/statement/customerInterface/login', // 登录
  DeptList = '/statement/customerInterface/listDept', // 查询所有部门
  DeptUserList = '/statement/customerInterface/listDeptUser', // 查询部门所有员工
  Msg = '/statement/customerInterface/sendMessage' // 催办消息接口
}

/**
 * @description: 用户登录
 */
export function login(params: LoginParams) {
  return http.request<UserInfoModel>(
    {
      url: Api.Login,
      method: 'POST',
      params
    },
    {
      isShowMessage: false
    }
  )
}

/**
 * @description: 查询所有部门
 */
export function getDeptList() {
  return http.request(
    {
      url: Api.DeptList,
      method: 'POST'
    },
    {
      isShowMessage: false
    }
  )
}
